CC := gcc
CXX := g++

LIBPATH := ../lib
LIBS := -lphoenix -lpthread 
CFLAGS := -Wall -D_LINUX_ -D__x86_64__ -g -I ../include
LDFLAGS := -L$(LIBPATH) -lphoenix -lpthread -Wl,-rpath=$(LIBPATH)

SOURCES := histogram.c main.c
OBJS := histogram.o main.o

EXE := histogram
SEQ_EXE := histogram-seq

PROGS = histogram histogram-seq 

$(EXE) : $(OBJS)
	$(CXX) $(CFLAGS) $^ -o $@ $(LDFLAGS)

main.o : main.c
	$(CXX) $(CFLAGS) -O3 -c $^ -o $@

histogram.o: histogram.c
	$(CXX) $(CFLAGS) -O3 -c $^ -o $@	

seq : histogram-seq.c
	$(CXX) $(CFLAGS) $^ -o $(SEQ_EXE) 


.PHONY: clean
clean:
	rm -f $(EXE) $(SEQ_EXE) *.o
